//
//  TaskCell.m
//  N2ST
//
//  Created by Eduardo Oliveros on 01/01/09.
//  Copyright 2009 Eduardo Oliveros. All rights reserved.
//

#import "TaskCell.h"


@implementation TaskCell

- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
	if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
		UILabel *labelView = NULL;
		UILabel *durationView = NULL;

		// Initialization code
		//Create the text view
		labelView = [[UILabel alloc] initWithFrame: CGRectMake(10, 0, 280, 40)];
		[labelView setTag:222];
		[labelView setFont:[UIFont fontWithName:@"Helvetica-Bold" size:14.0f]];
		[labelView setTextColor:[UIColor blackColor]];
		//[labelView setLineBreakMode: 0];
		[labelView setNumberOfLines:2];
		[self addSubview: labelView];
		[labelView release];
		
		//Create the date view
		durationView = [[UILabel alloc] initWithFrame: CGRectMake(290, 0, 45, 20)];
		[durationView setTag:333];
		[durationView setFont:[UIFont fontWithName:@"Helvetica" size:10.0f]];
		[durationView setTextColor:[UIColor blueColor]];
		[self addSubview: durationView];
		[durationView release];		
	}
	return self;
}

-(void)setName:(NSString*)name{
	UILabel *labelView = NULL;

	//Recover the label
	labelView = (UILabel*)[self viewWithTag:222];
	[labelView setText:name];	
}

-(void)setDuration:(NSString*)duration{
	UILabel *durationView = NULL;

	//Recover the label
	durationView = (UILabel*)[self viewWithTag:333];
	[durationView setText:duration];	
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

	[super setSelected:selected animated:animated];

	// Configure the view for the selected state
}


- (void)dealloc {
	[super dealloc];
}


@end
